package com.example.jmeter.entity;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.HashMap;
import java.util.Map;

/**
 * @program: spring-agent
 * @description:
 * @author: zt22328 赵儒定
 * @create: 2023-04-19 13:55
 **/
@Data
@NoArgsConstructor
public class HTTPSampler {

    private String name;

    private String domain;

    private Integer port;

    private String path;

    private String protocol;

    private String method;

    private Boolean always_encode;

    private String body;

    private Map<String, String> headers = new HashMap<>();

    private String contentEncoding;

    private Boolean follow_redirects;

    private Boolean auto_redirects;

    private Boolean use_keepalive;

    private String DO_MULTIPART_POST;

    private String embedded_url_re;

    private Integer connect_timeout;

    private Integer response_timeout;

    public HTTPSampler(String name, String domain) {
        this.name = name;
        this.domain = domain;
        this.port = 80;
    }

    public HTTPSampler(String name, String domain, String path) {
        this.name = name;
        this.domain = domain;
        this.port = 80;
        this.path = path;
    }

    public HTTPSampler(String name, String domain, Integer port, String path) {
        this.name = name;
        this.domain = domain;
        this.port = port;
        this.path = path;
    }

    public HTTPSampler(String name, String domain, Integer port, String path, String protocol, String method) {
        this.name = name;
        this.domain = domain;
        this.port = port;
        this.protocol = protocol;
        this.path = path;
        this.method = method;
    }
}
